package day20171101;

import java.util.Scanner;

/**
 * Created by Administrator on 2017-11-1.
 */
public class ExceptionTest {


    public static void main(String[] args) {
        int a = 0;
        int b = 0;

        Scanner scaner = new Scanner(System.in);

        while (true) {
            System.out.println("Please input 1st int: ");
            a = scaner.nextInt();
            System.out.println("Please input 2nd int: ");
            b = scaner.nextInt();

            int c = 0;
            try {
                c = a / b;

            } catch (ArithmeticException e) {
                System.out.println("除数为0！");
            }
            System.out.println(a + " / " + b + " = " + c);

        }


    }
}
